

int countOperations(int num1, int num2)
{
    int sum = 0;
    while (num1 != 0 && num2 != 0)
    { // 判断是否为0
        if (num1 >= num2)
        {
            num1 = num1 - num2;
            sum++;
        }
        else
        {
            num2 = num2 - num1;
            sum++;
        }
    }
    return sum;
}